import { g, r } from '@/router/generator'
import Layout from '@/layout'

export default [
  // Content manage
  {
    path: '/transaction', name: 'TransactionUser', component: Layout,
    meta: { title: '账单记录', icon: 'el-icon-document', roles: ['ROLE_USER'] },
    children: [
      ...r('UserTransaction', '我的账单')
    ]
  },

  // Content manage
  {
    path: '/content', name: 'ContentManage', component: Layout,
    meta: { title: '内容管理', icon: 'el-icon-document', roles: ['ROLE_SUPER_ADMIN'] },
    children: [
      ...r('Content', '内容')
    ]
  },

  // Transaction Finance
  {
    path: '/content', name: 'ContentManage', component: Layout,
    meta: { title: '财务管理', icon: 'el-icon-document', roles: ['ROLE_FINANCE'] },
    children: [
      ...r('FianaceTransaction', '用户账单')
    ]
  },

  // Balance manage
  {
    path: '/balance', name: 'BalanceManage', component: Layout,
    meta: { title: '财务管理', icon: 'el-icon-money', roles: ['ROLE_SUPER_ADMIN'] },
    children: [
      ...g('Balance', '钱包余额'),
      ...r('BalanceLog', '余额变动记录'),
      ...g('SettleItem', '订单分账记录'),
      ...r('ProfitType', '分账类型设置'),
      ...r('Invoice', '交易凭证'),
      ...r('Transaction', '钱包记录'),
      ...r('Withdraw', '提现记录'),
      ...r('Deposit', '二维码支付记录'),
      ...r('Fee', '费用'),
      {
        path: `/statistics/index`,
        name: `Statistics`,
        meta: { title: '收款统计', icon: 'el-icon-caret-right' },
        component: async () => await require('../views/statistics/index.vue')
      }
    ]
  },

  // Profit manage
  // {
  //   path: '/profit', name: 'ProfitManage', component: Layout,
  //   meta: { title: '提成管理', icon: 'el-icon-c-scale-to-original', roles: ['ROLE_SUPER_ADMIN'] },
  //   children: [
  //     ...r('ProfitRule', '提成规则'),
  //     {
  //       path: `/commision/index`,
  //       name: `CommisionIndex`,
  //       meta: { title: '提成设置', icon: 'el-icon-caret-right' },
  //       component: async () => await require('../views/commision/index.vue')
  //     }
  //   ]
  // },

  // Product Manage
  {
    path: '/product', name: 'ProductManage', component: Layout,
    meta: { title: '产品管理', icon: 'el-icon-lollipop', roles: ['ROLE_SUPER_ADMIN'] },
    children: [
      // ...r('category', '产品分类'),
      ...g('Product', '产品'),
      // ...r('ProfitRule', '提成规则'),
      {
        path: `/commision/index`,
        name: `CommisionIndex`,
        meta: { title: '提成设置', icon: 'el-icon-caret-right' },
        component: async () => await require('../views/commision/index.vue')
      }
      // ...g('Specification', '规格')
    ]
  },

  // Order Manage
  {
    path: '/order', name: 'OrderManage', component: Layout,
    meta: { title: '订单管理', icon: 'el-icon-s-order', roles: ['ROLE_SUPER_ADMIN'] },
    children: [
      ...r('Order', '订单列表')
    ]
  },

  // Activity Manage
  {
    path: '/activity', name: 'ActivityManage', component: Layout,
    meta: { title: '预约活动', icon: 'el-icon-s-flag', roles: ['ROLE_SUPER_ADMIN'] },
    children: [
      ...r('Activity', '活动列表'),
      ...r('ActivityRecord', '报名记录')
    ]
  },

  // Store manage
  {
    path: '/store', name: 'StoreManage', component: Layout,
    meta: { title: '门店管理', icon: 'el-icon-s-home', roles: ['ROLE_SUPER_ADMIN'] },
    children: [
      ...r('Store', '门店列表')
    ]
  },

  // Printer manage
  {
    path: '/printer', name: 'PrinterManage', component: Layout,
    meta: { title: 'POS机管理&台码', icon: 'el-icon-printer', roles: ['ROLE_SUPER_ADMIN'] },
    children: [
      ...r('HuifuPosDevice', 'POS机&台码')
    ]
  },

  // User manage
  {
    path: '/user', name: 'UserManage', component: Layout,
    meta: { title: '用户管理', icon: 'el-icon-user', roles: ['ROLE_SUPER_ADMIN'] },
    children: [
      ...g('User', '用户'),
      ...r('TransactionRelation', '账号关系'),
      ...g('HuifuAccount', '汇付钱包')
    ]
  },

  // System manage
  {
    path: '/system', name: 'SystemManage', component: Layout,
    meta: { title: '系统选项', icon: 'el-icon-setting', roles: ['ROLE_SUPER_ADMIN'] },
    children: [
      ...r('Type', '词汇表'),
      ...r('Category', '分类'),
      ...r('Album', '相册'),
      // ...r('Picture', '图片'),
      ...r('Option', '配置')
    ]
  }
]
